///
/// \file    : IndexGraphicsPanel.h
/// \version : 1.0
/// \date    : 29/05/2012
/// \author  : grupo linker
///
#include "MageEmissionPanel.h"

namespace varayoc
{

namespace gui
{

namespace externalpanels
{

namespace linkerpanels
{

namespace graphicspanels
{

MageEmissionPanel::MageEmissionPanel()
{
   this->setName("MageEmissionPanel");
   this->setSubsystem("Linker");
   this->setSelectorPanelBar("QuickAccesBar");
   setupUi();
}

void MageEmissionPanel::setupUi()
{
   qDebug() << "MageEmissionPanel::setupUi ini";
   Int w = 640;   // ancho panel
   Int h = 480;   // alto panel
   resize(w, h);

   String   title1   = "Emisiones de Mage";
   String   title2   = "Transmisión";
   m_header = new HeaderControl(QString::fromUtf8(title1.c_str()), QString::fromUtf8(title2.c_str()));
   m_header->setParent(this);
   Int xH = 20;   // posicion horizontal Header
   Int yH = 20;   // posicion vertical Header
   m_header->move(xH, yH);

   m_groupBox  = new QGroupBox(this);
   m_groupBox->setObjectName(QString::fromUtf8("m_groupBox"));
   Int   lG = 200;
   Int   tG = 70;
   Int   wG = 180;
   Int   hG = 50;
   m_groupBox->setGeometry(QRect(lG, tG, wG, hG));

   BasicControlsCreator &bcc  = BasicControlsCreator::instance();

   // Iconos

   Int   wI = 60;
   Int   hI = 50;

   QIcon icon1;
   icon1.addFile(QString::fromUtf8(":/GraphicAids/Resources/GraphicAids/GA01LineEnabled.svg"), QSize(), QIcon::Normal, QIcon::Off);
   m_mageEmissionButton = bcc.createRadioButton("", m_groupBox);
   m_mageEmissionButton->setIcon(icon1);
   m_mageEmissionButton->setIconSize(QSize(wI, hI));
   m_mageEmissionButton->setAutoExclusive(False);
   m_mageEmissionButton->setCheckable(True);
   m_mageEmissionButton->setChecked(True);

   m_vectorButton.push_back(m_mageEmissionButton);

   Int   numberOfButtons = 5;
   Int   wL =  400;
   Int   hL =  50;
   Int   xL =  140;
   Int   yL =  75;
   m_buttonListControl  = new ButtonListControl(m_vectorButton, numberOfButtons, wL, hL);
   m_buttonListControl->setParent(this);
   m_buttonListControl->move(xL, yL);
   m_buttonListControl->setOnView(0);

   // connect's
//   connect(m_mageEmissionButton, SIGNAL(clicked()), this, SLOT(mageEmissionButtonSlot()));

   pack();

   qDebug() << "MageEmissionPanel::setupUi fin";
}

MageEmissionPanel::~MageEmissionPanel()
{
}

void MageEmissionPanel::mageEmissionButtonSlot()
{
   emit  mageEmissionSignal();
   m_buttonListControl->setOnView(0);
}

}}}}}
